package com.bodgittandscarper.broker.types;

/**
 * Enum describing startup and running mode of the Application. Following three modes is defined: Server, Alone and Client. 
 *   
 * Further description can found in <code>Start</code> class.  
 * 
 * @author Morten Rummelhoff
 * @see com.bodgittandscarper.broker.Start
 *
 */
public enum ModeFlag {

	/**
	 * In this mode, the Application starts up a GUI and establishes a RMI connection to the Server Application.
	 * The Server application must be started, and a valid RMI service must be registered with the RMI registry before any client 
	 * applications can be started.
	 */
	CLIENT("Client"),
	/**
	 * In this mode the Server Application starts. This means a connection to a database is established and a RMI service is registered
	 * with the RMI registry. Note that a <code>ServerStartupDialog</code> is shown to indicate where the database file is located.
	 * The dialog is presented initially.
	 */
	SERVER("Server"), 
	/**
	 * This mode indicates that the Application is running in Alone mode. Which means that a GUI is started and presented
	 * and a local database connection is established. Note that a <code>ServerStartupDialog</code> is shown to indicate where the database
	 * file is located. Also note, that no network connection is established. The application only runs in this JVM.
	 */
	ALONE("Alone");
	
	
	private String presentation;
	
	private ModeFlag(String mode) {
		presentation = mode;
	}
	
	/**
	 * Get this enums String representation.
	 * 
	 * @return This enums presentation name.
	 */
	public String getPresentation() {
		return presentation;
	}
	
}
